package com.aaa.service.impl;

import com.aaa.entity.DO.RentCaptureOperation;
import com.aaa.entity.result.Result;
import com.aaa.mapper.RentCaptureOperationMapper;
import com.aaa.service.RentCaptureOperationService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author ：陈凯歌
 * @date ：Created in 2021/1/27 20:42
 * @description：
 * @modified By：
 * @version:
 */
@Service
public class RentCaptureOperationImpl implements RentCaptureOperationService {

    /**
     * 注入RentCaptureOperationMapper
     */
    @Autowired
    private RentCaptureOperationMapper mapper;


    /**
     * 根据操作id删除数据
     */
    @Override
    public Result delOperation(Integer id) {

        //根据id删除数据
        int i = mapper.deleteById(id);
        //判断受影响的行数大于0
        if (i>0){
            return Result.succeed("删除成功");
        }

        return Result.error("删除失败");
    }

    /**
     * 修改数据
     * @param rentCaptureOperation
     * @return
     */
    @Override
    public Result upOpera(RentCaptureOperation rentCaptureOperation) {

        int i = mapper.updateById(rentCaptureOperation);
        //判断受影响行数大于0
        if (i>0){
            return Result.succeed("修改成功");
        }
        return Result.error("修改失败");
    }
}
